Skip to content

Added DisplaySurfaceChangeCallback#289

Open
tovepet wants to merge 1 commit intow3c:gh-pagesfrom
tovepet:display-surface-change-255
Open

Added DisplaySurfaceChangeCallback#289
tovepet wants to merge 1 commit intow3c:gh-pagesfrom
tovepet:display-surface-change-255

Conversation

@tovepet
Copy link
Copy Markdown

@tovepet tovepet commented Nov 30, 2023

Copy link
Copy Markdown
Member

@eladalon1983 eladalon1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, but some suggestions.

Comment thread index.html
<dfn>capture-session</dfn>.</p>
<dfn>capture-session</dfn>, with the associated
[=capture-source-set=], <var>sources</var>.</p>
</li>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the part below, which dealt with controller.[[Source]], be updated to reference the video source from capture-source-set rather than (as it does now) the "video track's source"?
(GitHub didn't let me attach this comment in the desired location.)

Comment thread index.html
The user agent MUST NOT change the [=display surface=]
associated with a [=capture-session=] unless the user has
explicitly indicated that they want this change to be
performed by interacting with user agent or operating system.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could you make editorial changes here so as to discourage anyone from misreading "by interacting" as binding to the wrong part of the sentence? Maybe "...performed. Users can do this by interacting with..."

Comment thread index.html Outdated
Comment thread index.html Outdated
@tovepet tovepet force-pushed the display-surface-change-255 branch from ab47c8a to 7c6434f Compare October 2, 2024 13:02
Comment thread index.html


<p>
The user agent MUST NOT change the [=display surface=]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can validate this, I would tend to reword so that we do not use MUST NOT.

Comment thread index.html
explicitly indicated that they want this change to be
performed by interacting with user agent or operating system.

If the user indicates a change of [=display surface=], the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to specify the order of the callback execution and the configurationchange event at MediaStreamTrack.
I would tend to have the event be executed after the callback.

Comment thread index.html

<li>
<p>Stop delivering frames from all sources in the
[=capture-source-set=] associated with the [=capture-session=].
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If audio source is not changing, should we allow audio to flow?

Comment thread index.html


<p>
<var>newSources</var> MUST fulfill the same requirements as the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really clear to me what this MUST is about.

Comment thread index.html

<li>
<p>If <var>controller.{{CaptureController/[[DisplaySurfaceChangeCallback]]}}</var>
is null, abort these steps.</p>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do this check later inside a task queued since CaptureController/[DisplaySurfaceChangeCallback] can be changed at any point in time by JS, so the checks should be done within the context event loop.

Comment thread index.html


<li>
<p>Queue a task to:</p>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it have a link to the definition?
We should probably start using a task source as well.

Comment thread index.html
<li>
<p>Run the [=ApplyConstraints algorithm=] on all tracks in
<var>stream</var> with the appropriate constraints. Should
this fail, abort these steps.</p>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we fail, user wants to switch, it is ok for the web page to update its constraints as part of the switch.

Comment thread index.html

<li>
<p>Queue tasks to end all tracks connected to sources in the
[=capture-source-set=] associated with the [=capture-session=].
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default should be to leave the tracks alive, the future option being for the web page to ask for tracks to be ended.
The principle is that a web page can easily implement ending of the tracks, but it cannot implement the reverse.

Comment thread index.html


<li>
<p>If [=this=].{{CaptureController/[[IsBound]]}} is
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems restrictive to disallow setting the callback more dynamically.
Why should we add this restriction?

Comment thread index.html
<p>If
[=this=].{{CaptureController/[[DisplaySurfaceChangeCallback]]}}
is not <code>null</code>, [=exception/throw=] an
"{{InvalidStateError}}" {{DOMException}}.</p>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why we should not allow to overwrite the callback either.

Copy link
Copy Markdown
Member

@jan-ivar jan-ivar Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems different from w3c/mediacapture-screen-share-extensions#4 (comment):

Something like captureController.processSourceSwitch(stream => { ... }); or captureController.processSourceSwitch(null);

I’m fine with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-pause capture when user switches captured content

4 participants